package com.lzdongrui.backend.controller;

import com.lzdongrui.backend.service.IIndexService;
import com.lzdongrui.common.core.controller.BaseController;
import com.lzdongrui.common.core.domain.AjaxResult;
import com.lzdongrui.common.core.domain.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/backend")
public class IndexController extends BaseController {

    @Autowired
    private IIndexService indexService;

    @GetMapping("/index")
    public AjaxResult index(SysUser user) {
        user.setUserId(getUserId());
        user.setDeptId(getDeptId());
        return success(indexService.index(user));
    }
}
